<template>
	<panel-privacy v-model="show" @submit="handleConfirm"></panel-privacy>
</template>

<script setup>
	import PanelPrivacy from './components/privacy.vue'
	import {
		ref
	} from 'vue'
	import {
		onLoad
	} from '@dcloudio/uni-app'

	const __privacy__key = '__privacy__key'

	onLoad(() => {
		if (uni.getStorageSync(__privacy__key)) {
			toHome()
		}
	})

	const show = ref(true)

	const handleConfirm = () => {
		uni.setStorageSync(__privacy__key, true);
		toHome()
	}


	function toHome() {
		uni.reLaunch({
			url: '/pages/index/index'
		})
	}
</script>